package jumpingnotes.model.entity;

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

@Entity
@Table(name = "friend_confirm", catalog = "jumping_notes")
public class FriendConfirm implements java.io.Serializable
{

	private Integer friendConfirmId;
	private Member memberByMemberIdFrom;
	private Member memberByMemberIdTo;
	private String message;
	private Date createTime;

	public FriendConfirm()
	{
	}

	public FriendConfirm(Member memberByMemberIdFrom, Member memberByMemberIdTo)
	{
		this.memberByMemberIdFrom = memberByMemberIdFrom;
		this.memberByMemberIdTo = memberByMemberIdTo;
	}

	public FriendConfirm(Member memberByMemberIdFrom, Member memberByMemberIdTo, String message, Date createTime)
	{
		this.memberByMemberIdFrom = memberByMemberIdFrom;
		this.memberByMemberIdTo = memberByMemberIdTo;
		this.message = message;
		this.createTime = createTime;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "friend_confirm_id", unique = true, nullable = false)
	public Integer getFriendConfirmId()
	{
		return this.friendConfirmId;
	}

	public void setFriendConfirmId(Integer friendConfirmId)
	{
		this.friendConfirmId = friendConfirmId;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "member_id_from", nullable = false)
	public Member getMemberByMemberIdFrom()
	{
		return this.memberByMemberIdFrom;
	}

	public void setMemberByMemberIdFrom(Member memberByMemberIdFrom)
	{
		this.memberByMemberIdFrom = memberByMemberIdFrom;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "member_id_to", nullable = false)
	public Member getMemberByMemberIdTo()
	{
		return this.memberByMemberIdTo;
	}

	public void setMemberByMemberIdTo(Member memberByMemberIdTo)
	{
		this.memberByMemberIdTo = memberByMemberIdTo;
	}

	@Column(name = "message", length = 65535)
	public String getMessage()
	{
		return this.message;
	}

	public void setMessage(String message)
	{
		this.message = message;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "create_time", length = 19)
	public Date getCreateTime()
	{
		return this.createTime;
	}

	public void setCreateTime(Date createTime)
	{
		this.createTime = createTime;
	}

}
